package com.acwing.partition21;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

/**
 * @author `RKC`
 * @date 2022/5/10 15:58
 */
public class AC2022倍数17 {

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String a = reader.readLine();
        //17->10001
        String b = a + "0000";
        List<Integer> ls1 = new ArrayList<>(), ls2 = new ArrayList<>();
        for (int i = a.length() - 1; i >= 0; i--) ls1.add(a.charAt(i) - '0');
        for (int i = b.length() - 1; i >= 0; i--) ls2.add(b.charAt(i) - '0');
        List<Integer> ls3 = add(ls1, ls2);
        for (int i = ls3.size() - 1; i >= 0; i--) writer.write(ls3.get(i) + "");
        writer.flush();
    }

    private static List<Integer> add(List<Integer> a, List<Integer> b) {
        List<Integer> res = new ArrayList<>();
        int t = 0;
        for (int i = 0; i < a.size() || i < b.size(); i++) {
            if (i < a.size()) t += a.get(i);
            if (i < b.size()) t += b.get(i);
            res.add(t % 2);
            t /= 2;
        }
        if (t != 0) res.add(t);
        return res;
    }
}
